package com.sky.mapper.user;

import com.sky.pojo.OrderDetail;
import com.sky.pojo.Orders;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.time.LocalDateTime;
import java.util.List;

public interface UserOrderMapper {


    void insert(Orders orders);

    @Select("select * from orders where order_time < #{time} and status = 1")
    List<Orders> selectOrderBytime(LocalDateTime time);

    @Update("update orders set status = #{status} ,pay_status = #{payStatus} where id = #{id}")
    void updateOrderPaySuccess(Orders order);
    @Update("update orders set status = #{status} ,pay_status = #{payStatus},cancel_time = #{cancelTime} , cancel_reason = #{cancelReason} where id = #{id}")
    void cancelOrder(Orders order);
    @Select("select * from orders where number = #{number}")
    Orders getByNumber(String number);
    @Select("select * from orders where id = #{id}")
    Object selectOrderById(Integer orderId);
}
